﻿@using Kojarskiy.Core
@using Kojarskiy.Models
@using SiteMap = Kojarskiy.Models.SiteMap
@model string
@{
    var context = new KojarskiyDbEntities();
    switch (Model)
    {
            case "Menu":
                var siteMapNode = (SiteMap)ViewData["SiteMapNode"];
                if(siteMapNode.Children.Count > 0)
                {
                    var pages = siteMapNode.Children;
                    @Html.Partial("_LeftMenu", pages)
                }
                else
                {
                    var pages = context.SiteMap.Where(x => x.ParentId == siteMapNode.ParentId && x.Show);
                    @Html.Partial("_LeftMenu", pages)
                }
            break;         
    }
}

<script type="text/javascript">

</script>